package com.lams.action.archive;

import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;

import com.lams.action.SubAction;
import com.lams.service.archive.IUnitFacade;
import com.lams.util.ResultEntity;
import com.lams.util.TreeEntity;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;

public class UnitAction extends SubAction {
	private IUnitFacade uf;
	private String node;
	public IUnitFacade getUf() {
		return uf;
	}

	public void setUf(IUnitFacade uf) {
		this.uf = uf;
	}
	
	public String getNode() {
		return node;
	}

	public void setNode(String node) {
		this.node = node;
	}

	public String findUnitTree(){
		//String id = getNode();
		List<TreeEntity> data = uf.findUnitTreeByParOrgNo(node);
		this.setResult(JSONArray.fromObject(data).toString());
		return Action.SUCCESS;
	}
	
}
